#!/bin/sh
# @(#)$Id: e1432supp,v 1.13 1998/05/27 17:37:08 ericb Exp $
# Copyright (C) 1996 - 1998, Hewlett-Packard Company, all rights reserved.
# Written by Eric Backus

# Prints out useful information to help debug E1432 system problems.

if [ $# -gt 0 ]; then
    echo Usage: $0
    echo Prints E1432 and System configuration info to stdout
    exit 1
fi

PATH=$PATH:/opt/sicl/bin:/usr/pil/bin

osrev=`uname -r | cut -d. -f2`
if [ $osrev -eq 9 ]; then
    libdir=/usr/lib
    etcdir=/usr/pil/etc
else
    libdir=/opt/sicl/lib
    etcdir=/etc/opt/sicl
fi
cfdir=`ls -d $etcdir/vxi* | cut -d\  -f1`

echo System Information
echo ==================
date
uname -a
echo osrev $osrev libdir $libdir etcdir $etcdir cfdir $cfdir
echo
echo File Revision Information
echo =========================
what /bin/cc /bin/ld $libdir/libsicl.sl
if [ $osrev -gt 9 ]; then
    what /usr/lib/libvisa.sl /opt/vxipnp/hpux/hpe1432/hpe1432.sl
fi
what /opt/e1432/lib/lib1432.* /opt/e1432/lib/libd1432.a /opt/e1432/lib/sema.bin
what /opt/e1432/arbsrc/srcrom.bin
what /opt/e1432/bin/e1432supp /opt/e1432/bin/hostdiag
echo
echo SICL VXI Configuration Information
echo ==================================
for file in $etcdir/*.cf $cfdir/oride.cf $cfdir/ttltrig.cf; do
    echo
    echo $file:
    grep -v '^$' $file | grep -v '^#'
done
if [ $osrev -gt 9 ]; then
    echo
    echo Plug\&Play VXI Configuration Information
    echo =======================================
    echo
    echo /etc/opt/vxipnp/hpux/hpvisa/hpvisa.ini
    cat /etc/opt/vxipnp/hpux/hpvisa/hpvisa.ini
fi
echo
echo SICL VXI Current Configuration Information
echo ==========================================
iclear vxi
sleep 10
ivxisc $cfdir
echo
echo E143x Module Bootup Information For LA8
echo =======================================
echo "The following assumes an E143x module at VXI Logical Address 8."
echo "It will error if this is not true."
/opt/e1432/bin/hwinstall -Cz -v1 -dvxi -L8 -Mvxi -f/opt/e1432/lib/sema.bin &
/opt/e1432/bin/e1432mon -ft15
echo
echo E143x Host Diagnostics Information For LA8
echo ==========================================
echo "The following assumes an E143x module at VXI Logical Address 8."
echo "It will error if this is not true."
/opt/e1432/bin/hostdiag -L8 -v
